<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../新建文件夹 (5)/abc/node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <label>
            <input type="checkbox" name="checkAll" v-model="checkAll" @change="change">全选
        </label>

        <hr>
      


       <label v-for="(item,index) in hobbyList" :key="index">
        <input type="checkbox" name="item":value="item" v-model="selected">{{item}}
       
       
       
       </label>
<hr>
       {{selected}}{{checkAll}}
       <hr>
       


    </div>

    <script>
        new Vue({
            el:'#app',
            data:{
                checkAll:false,
                selected:[],
                hobbyList:[
                    '吃饭',
                    '睡觉',
                    '打豆豆'
                ]

                
            },
            methods:{
                changes(){
                    console.log(this.checkAll);
                }
            }
        })





    </script>
</body>
</html>